<template>
  <div>

    <component
      :is="myComponent"
      @balance-reload="load()"
      @redirect="homeReload"
    ></component>
  </div>
</template>

<script>
import province from "./province";
import city from "./city";

export default {
  name: "balance",
  components: {
    province,
    city,
  },
  data() {
    return {
      myComponent: null,
    };
  },
  computed: {
    mapLevel: {
      get() {
        return this.$store.state.home.mapLevel;
      },
    },
  },
  created() {},
  mounted() {
    this.load();
  },
  methods: {
    jump(){

      this.$emit("redirect", "resource", "didiao");
    },

    load() {
      if (this.mapLevel == "1") {
        this.myComponent = province;
      } else {
        this.myComponent = city;
      }
    },
    homeReload(menu, subMenu) {
      this.$emit("home-reload", menu, subMenu);
    },
  },
};
</script>

<style scoped></style>
